//
//  WHProgressHUD.m
//  MoYou
//
//  Created by she1323 on 16/10/14.
//  Copyright © 2016年 she1323. All rights reserved.
//

#import "WHProgressHUD.h"
#import <SVProgressHUD.h>

@implementation WHProgressHUD

+ (void)setMinimumDismissTimeInterval:(NSInteger)time
{
    [SVProgressHUD setMinimumDismissTimeInterval:1];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
}

+ (void)showError:(NSString *)title
{
    [self setMinimumDismissTimeInterval:20];
    if ([title isKindOfClass:[NSNull class]]) {
        title = @"";
    }
    [SVProgressHUD showErrorWithStatus:title];
    
}

+ (void)showSuccess:(NSString *)title
{
    [self setMinimumDismissTimeInterval:1];
    [SVProgressHUD showSuccessWithStatus:title];
    
}

+ (void)showStatus:(NSString *)title
{
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
    [SVProgressHUD showWithStatus:title];
}

+ (void)showStatusGradient:(NSString *)title
{
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeGradient];
    [SVProgressHUD showWithStatus:title];
}

+ (void)dismiss
{
    [SVProgressHUD dismiss];
}

+ (void)checkNetPlease
{
    [self setMinimumDismissTimeInterval:1];
    [SVProgressHUD showErrorWithStatus:@"请检查网络"];
}


@end
